﻿const express = require('express');
const MongoClient = require('mongodb').MongoClient;


const router = express.Router();

const locationStorage ={
    locations:[]
};
router.post('/add-location',  (req, res) => {
    const id = Math.random();
    locationStorage.locations.push({
        id:id,
        address:req.body.address,
        coords:{lat:req.body.lat,lng:req.body.lng}
    });
    res.json({message:'Stored location!',locId : id});
});

router.get('/location',  (req, res) => {

});

module.exports = router;